home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
netdmo.exe
/
CLEARCON.FRM
next >
Wrap
Text File
|
1993-12-10
|
4KB
|
168 lines
Version 1.00
BEGIN Form Clearcon
AutoRedraw = 0
BackColor = QBColor(1)
BorderStyle = 1
Caption = "Clear Connection"
ControlBox = -1
Enabled = -1
ForeColor = QBColor(0)
Height = Char(17)
Left = Char(8)
MaxButton = -1
MinButton = -1
MousePointer = 0
Tag = ""
Top = Char(2)
Visible = -1
Width = Char(64)
WindowState = 0
BEGIN ComboBox Userslist
BackColor = QBColor(1)
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(1)
Left = Char(1)
MousePointer = 0
Sorted = 0
Style = 0
TabIndex = 0
TabStop = -1
Tag = ""
Text = ""
Top = Char(3)
Visible = -1
Width = Char(25)
END
BEGIN Label Label1
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "This utility will logout a user without warning them. "
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(1)
Left = Char(2)
MousePointer = 0
TabIndex = 3
Tag = ""
Top = Char(1)
Visible = -1
Width = Char(56)
END
BEGIN CommandButton OKClear
BackColor = QBColor(7)
Cancel = 0
Caption = "Clear"
Default = 0
DragMode = 0
Enabled = -1
Height = Char(3)
Left = Char(37)
MousePointer = 0
TabIndex = 1
TabStop = -1
Tag = ""
Top = Char(4)
Visible = -1
Width = Char(11)
END
BEGIN CommandButton Cancel1
BackColor = QBColor(7)
Cancel = 0
Caption = "Exit"
Default = 0
DragMode = 0
Enabled = -1
Height = Char(3)
Left = Char(37)
MousePointer = 0
TabIndex = 2
TabStop = -1
Tag = ""
Top = Char(10)
Visible = -1
Width = Char(11)
END
BEGIN Label Label2
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "CAUTION!!! CAUTION!!! CAUTION!!!"
DragMode = 0
Enabled = -1
ForeColor = QBColor(12)
Height = Char(1)
Left = Char(2)
MousePointer = 0
TabIndex = 4
Tag = ""
Top = Char(0)
Visible = -1
Width = Char(60)
END
END
'$FORM Netdemo
TYPE ConInfo
ConnectNum AS INTEGER
ReturnCode AS INTEGER
ObjectType AS INTEGER
ObjectName AS STRING * 48
END TYPE
TYPE clcon
ConnectNum AS INTEGER
ReturnCode AS INTEGER
END TYPE
DECLARE SUB GetConnectionInfo (Info AS ConInfo)
DECLARE SUB ClearConnection (ClearCon1 AS clcon)
SUB Cancel1_Click ()
ClearCon.HIDE
Netdemo.SHOW
END SUB
SUB Form_Load ()
DIM Info AS ConInfo
DIM num1 AS STRING * 4
FOR i% = 1 TO 100
Info.ConnectNum = i%
CALL GetConnectionInfo(Info) 'Call the Procedure
Name$ = RTRIM$(Info.ObjectName$)
strlen% = LEN(Name$)
Name2$ = MID$(Name$, 3, strlen%) 'Strip the Nul chars.
Username$ = Name2$
name1% = INSTR(Name$, "NOT-LOGGED-IN")
IF name1% > 0 THEN GOTO notconnected
IF Info.ObjectType = 1 THEN
num1 = STR$(Info.ConnectNum)
UsersList.ADDITEM num1 + Name2$
UsersList.Listindex = 0
END IF
notconnected:
NEXT i%
END SUB
SUB Form_Unload (Cancel AS INTEGER)
Netdemo.SHOW
END SUB
SUB OKClear_Click ()
DIM ClearCon1 AS clcon
Usercon1$ = (MID$(UsersList.text, 1, 4))
msg$ = "You are about to clear connection: " + Usercon1$
x% = MSGBOX(msg$, 1, "Confirm Clear Connection")
IF x% = 2 THEN GOTO abort1:
ClearCon1.ConnectNum% = VAL(MID$(UsersList.text, 1, 4))
CALL ClearConnection(ClearCon1)
IF ClearCon1.ReturnCode% = 198 THEN msg$ = "Only Supervisor or equivelent may clear a connection."
IF ClearCon1.ReturnCode% = 0 THEN msg$ = "Connection " + STR$(ClearCon1.ConnectNum%) + " Has Been Cleared"
MSGBOX msg$
abort1:
END SUB